package com.hexacta.hrs.domain.staffing.assignment;

import java.io.Serializable;
import java.util.Calendar;

import org.vectrics.employee.Employee;
import org.vectrics.recruiter.job.JobFunction;

import com.hexacta.hrs.domain.staffing.ParticionablePorFecha;
import com.hexacta.hrs.domain.staffing.Project;

/**
 * Asignacion de un empleado a un proyecto.
 * 
 * @author ncortinez
 *
 */
public class EmployeeAssignment  implements Serializable,Cloneable,ParticionablePorFecha {
	
	private static final long serialVersionUID = 8950674051815271333L;

	private Long id;
	
	// Es el rol que fue contratado. Puede no coincidir con el rol del empleado.
	private JobFunction assignedRole;
    private AssignmentType assignmentType;
	private Employee employee;
	private Project project;
	private double assignmentPorcentage;
	private String comments;
	private Calendar endDate;
	private Calendar startDate;
	private boolean tentative;

	public EmployeeAssignment(){
	}

	public Object clone() throws CloneNotSupportedException {
	    return super.clone();
	}
	
	/**
	 * GETTERS and SETTERS 
	 */

	public JobFunction getAssignedRole() {
		return assignedRole;
	}

	public void setAssignedRole(JobFunction assignedRole) {
		this.assignedRole = assignedRole;
	}

	public AssignmentType getAssignmentType() {
		return assignmentType;
	}

	public void setAssignmentType(AssignmentType assignmentType) {
		this.assignmentType = assignmentType;
	}

	public Employee getEmployee() {
		return employee;
	}

	public void setEmployee(Employee employee) {
		this.employee = employee;
	}

	public Project getProject() {
		return project;
	}

	public void setProject(Project project) {
		this.project = project;
	}

	public double getAssignmentPorcentage() {
		return assignmentPorcentage;
	}

	public void setAssignmentPorcentage(double assignmentPorcentage) {
		this.assignmentPorcentage = assignmentPorcentage;
	}

	public String getComments() {
		return comments;
	}

	public void setComments(String comments) {
		this.comments = comments;
	}

	public Calendar getEndDate() {
		return endDate;
	}

	public void setEndDate(Calendar endDate) {
		this.endDate = endDate;
	}

	public Calendar getStartDate() {
		return startDate;
	}

	public void setStartDate(Calendar startDate) {
		this.startDate = startDate;
	}

	// Este getters debe existir para poder hacer el mappeo usando hibernatte.
	public boolean getTentative(){
		return this.isTentative();
	}
	
	public boolean isTentative() {
		return tentative;
	}

	public void setTentative(boolean tentative) {
		this.tentative = tentative;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Long getId() {
		return id;
	}
	
}
